package training;

import java.util.Scanner;
import java.util.*;
// https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b?orderByHotValue=1&page=1&onlyReference=false
// 注意类名必须为 test.Main, 不要有任何 package xxx 信息
public class Day1_01 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int[] arr = new int[3*n];
        for(int i = 0; i < 3*n; i++){
            arr[i] = in.nextInt();
        }
        Arrays.sort(arr);
        int len = arr.length;
        long res = 0;
        for(int i = 0 ; i < n; i++){
            res += arr[len-2];
            len-=2;
        }
        System.out.println(res);
    }
}